using System;
using Sponsorship.Domain;

namespace Sponsorship.Infrastructure
{
    /// <summary>
    /// Defines an interface for classes allowing domain commands (implementing <see cref="ICommand"/>) to be sent to their respective command
    /// handlers. The UI layer uses an instance of this type to send commands to the domain logic.
    /// </summary>
    public interface IBus
    {
        void RegisterHandler<T> (Action<T> handler) where T : IEvent;
        void Send<T> (T command) where T : ICommand;
    }
}